#ifndef PARSER_H
#define PARSER_H

#include <QObject>
#include <QStringList>
#include <QStandardItemModel>

class Parser : public QObject
{
    Q_OBJECT

    QStringList InternalClassList;
    QStringList ReservedTokensList;

public:
    explicit Parser(QObject *parent = 0);
    void acceptModel( QStandardItemModel * m ) { mdl = m; }

private:
    void parse( const QString & str );
    QStandardItemModel * mdl;
    QStandardItem * appendTokenList( const QString & t, QStandardItem * p = 0 );
    bool checkVariable( QString & v );
    QString checkReservedClassName( QString className );

signals:
    void sgnHighlightToken( QString r );
    void sgnAddToken( QString t );
    
public slots:
    void sltParse( const QString & str ) { parse( str ); }
};

#endif // PARSER_H
